package com.server.rule.component;

import java.util.ArrayList;
import java.util.List;

public class DecisionHandler {

	
	private List<RuleDecision> decisions = new ArrayList<RuleDecision>();

	public void addDecision(RuleDecision decision){
		decisions.add(decision);
	}
	
	public List<RuleDecision> getFinalDecision(){
		if(decisions.size()>1) decisions.remove(0);
		return decisions;
	}
	
	public void setDefault(RuleDecision decision){
		decisions.add(0, decision);
	}
	
	/**
	 * @param decisions the decisions to set
	 */
	public void setDecisions(List<RuleDecision> decisions) {
		this.decisions = decisions;
	}

	/**
	 * @return the decisions
	 */
	public List<RuleDecision> getDecisions() {
		return decisions;
	}
	
}
